#coding=utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
from base64 import urlsafe_b64encode, urlsafe_b64decode

def uri_b64encode(s):

     return urlsafe_b64encode(s).strip('=')

def uri_b64decode(s):
     return urlsafe_b64decode(s + '=' * (4 - len(s) % 4))

